﻿
using System.Collections.Generic;

namespace Enferno.Public.Web.Models
{
    public class ProductItemModel : ProductItemCustomVariantModel<VariantModel>
    {
        
    }

    public class ProductItemCustomVariantModel<TVariantModel> :
        ProductItemBaseModel
            <TVariantModel, ProductFileModel, ProductManufacturerModel, PriceModel, OnHandStatusModel, ParametricModel,
                ParametricValueModel>
        where TVariantModel :
            VariantBaseModel<OnHandStatusModel, PriceModel, ProductFileModel, ParametricModel, ParametricValueModel>
    {
        public ProductItemCustomVariantModel() : base()
        {
            
        }
    } 

    public class ProductItemBaseModel<TVariantModel, TProductFileModel, TProductManufacturerModel, TPriceModel, TOnHandStatusModel, TParametricModel, TParametricValueModel>
        where TVariantModel: VariantBaseModel<TOnHandStatusModel, TPriceModel, TProductFileModel, TParametricModel, TParametricValueModel>
        where TProductFileModel: ProductFileModel
        where TProductManufacturerModel : ProductManufacturerModel
        where TPriceModel: PriceModel
        where TOnHandStatusModel: OnHandStatusModel
        where TParametricModel: ParametricBaseModel<TParametricValueModel>
        where TParametricValueModel: ParametricValueModel
    {
        public ProductItemBaseModel()
        {
            Files = new List<TProductFileModel>();
            Variants = new List<TVariantModel>();
            Parametrics = new List<TParametricModel>();
        }

        public int Id { get; set; }

        public string Name { get; set; }
        public string UniqueName { get; set; }
        public string SubHeader { get; set; }

        public TProductManufacturerModel Manufacturer { get; set; }
        public List<int> Flags { get; set; }

        public TPriceModel Price { get; set; }
        public decimal RecommendedQuantity { get; set; }
        public bool IsRecommendedQuantityFixed { get; set; }

        public List<TProductFileModel> Files { get; set; }
        public List<TVariantModel> Variants { get; set; }

        public TOnHandStatusModel OnHandStatus { get; set; }

        public int CategoryId { get; set; }
        public int? PopularityRank { get; set; }

        public int StatusId { get; set; }

        public List<TParametricModel> Parametrics { get; set; }

        public string Url { get; set; }    
    }
}
